#ifndef GFX_H
#define GFX_H

#include "base.h"

typedef struct
{
    int width, height;
    int multisampling;
} GFX_Resolution;

enum GFX_colors { GFX_BLACK, GFX_BLUE, GFX_GREEN, GFX_CYAN, GFX_RED, GFX_MAGENTA, GFX_BROWN, GFX_LIGHTGRAY, GFX_DARKGRAY,
                  GFX_LIGHTBLUE, GFX_LIGHTGREEN, GFX_LIGHTCYAN, GFX_LIGHTRED, GFX_LIGHTMAGENTA, GFX_YELLOW, GFX_WHITE };

int gfx_set_resolution(GFX_Resolution res);
void gfx_get_resolution(GFX_Resolution *res);

void gfx_matrix_push(mat3 m);   // décrémente la pile de matris et recalcul la matris courante
void gfx_matrix_pop(void);      // incrémente la pile de matris et recalcul la matris courant

void gfx_scene_begin(void);
void gfx_scene_end(void);
void gfx_scene_set(void);

void gfx_draw_set_color(int color);
void gfx_draw_set_bkcolor(int color);
void gfx_draw_line(float x1, float y1, float x2, float y2);
void gfx_draw_rectangle(float x1, float y1, float x2, float y2);
void gfx_draw_circle(float r);
void gfx_draw_text(float x, float y, const char *text);
void gfx_draw_image(const char *name, float x, float y);

int gfx_image_get_height(const char *name);
int gfx_image_get_width(const char *name);

void gfx_read_imagefile(const char* filename, int xTopLeft, int yTopLeft, int width, int height);
void gfx_clear_device(void);

void gfx_set_text_style(int font, int direction, int charsize);
void gfx_custom_color(int red, int green, int blue);

void gfx_set_blur(float blur);

int gfx_keyboard_state_change(void);
int gfx_keyboard_input(void);

//
// Initialization
//

void gfx_init(void);
void gfx_exit(void);

#endif

